﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using condortravel.operaciones.common.Log;

namespace CondorTravelOperacionesWeb.Controls
{
    public partial class UCMessageForm : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void showMessage(string message, ELogLevel level)
        {
            this.lblAviso.Text = message;
            if (!message.Equals(string.Empty))
            {
                this.pnlAviso.Visible = true;
                switch (level)
                {
                    case ELogLevel.INFO:
                        this.imgConforme.Visible = true;
                        this.imgError.Visible = false; break;
                    case ELogLevel.ERROR:
                        this.imgConforme.Visible = false;
                        this.imgError.Visible = true; break;

                }
            }
        }
        public void cleanMessage()
        {
            this.lblAviso.Text = String.Empty;
            this.pnlAviso.Visible = false;
            this.imgConforme.Visible = false;
            this.imgError.Visible = false;
        }
    }
}